package weak_20241227_29.stream;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * @author zdl
 * @date 2024/12/28
 */
public class Demo23 {
    public static void main(String[] args) {
        //23. 将字符串中的每个单词首字母转换为大写。
        String str = "what is your name";
        Arrays.stream(str.split(" ")).map(s -> Character.toUpperCase(s.charAt(0)) + s.substring(1)).forEach(s -> System.out.print(s + " "));
    }
}
